package com.zb.service.impl;

import com.zb.dao.ReceiveAreaMapper;
import com.zb.model.TReceiveArea;
import com.zb.service.ReceiveAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReceiveServiceImpl implements ReceiveAreaService {

	@Autowired
	private ReceiveAreaMapper lm;
	
	@Override
	public boolean addAreaService(String areaID, String userid, String shoujianren, String suozaidi, String xiangxi,
			String shoujianphone) {
//		TReceiveArea ta=new TReceiveArea();
//		ta.setAreaID(areaID);
//		ta.setAreaID(ismoren);
//		ta.setShoujianphone(shoujianphone);
//		ta.setSuozaidi(suozaidi);
//		ta.setSuozaidi(userid);
//		ta.setXiangxi(xiangxi);
//		ta.setShoujianren(shoujianren);
		lm.addAreaService(areaID, userid, shoujianren, suozaidi, xiangxi, shoujianphone);
		return true;
	}

	@Override
	public List<TReceiveArea> selectAreaService(String userid) {
		return lm.selectAreaService(userid);
	}

	@Override
	public boolean deleteAreaService(String areaID) {

		return lm.deleteAreaService(areaID);
	}


	@Override
	public boolean updateAreaService(String areaID, String userid, String shoujianren, String suozaidi, String xiangxi,
			String shoujianphone) {
		TReceiveArea ta=new TReceiveArea();
		ta.setAreaID(areaID);
		ta.setShoujianphone(shoujianphone);
		ta.setShoujianren(shoujianren);
		ta.setSuozaidi(suozaidi);
		ta.setXiangxi(xiangxi);
		ta.setUserid(userid);
		System.out.println("updateAreaService"+ta);
		return lm.updateAreaService(ta);
		
	}
	
}
